<?php
declare (strict_types = 1);

namespace app\middleware;

use think\Response;

class ApiUserLoginCheck
{
    /**
     * 处理请求
     *
     * @param \think\Request $request
     * @param \Closure       $next
     * @return Response
     */
    public function handle($request, \Closure $next)
    {
        if (empty($request->uid)) {
            return Response::create(['code' => 302,'data' => [],'message' => '未登录'],'json',402);
        }
        return $next($request);
    }
}
